package com.qf.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class TestController {
    // http://localhost:8080/test
    @RequestMapping(value = "/test")
    public ModelAndView test(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("test");    // request.getRequestDispatcher("").forward(req,resp);
        modelAndView.addObject("test","Hello SpringMVC!!");   // request.setAttr....
        return modelAndView;
    }
}
